package com.locationhistory.activity;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;

import com.locationhistory.R;

/**
 * 
 * @author thuanlv1
 *
 */
public class BaseActivity  extends Activity {

	
	/**
	 * setup to windown hide title bar, the screen is more full.
	 */
	public void initWindowParameters() {
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
		this.getWindow().requestFeature(Window.FEATURE_PROGRESS);
	}

	public void showDialog(String title, String message,
			final boolean isFinishedActivity) {
		AlertDialog alertDialog = new AlertDialog.Builder(this).create();
		alertDialog.setTitle(title);
		alertDialog.setIcon(R.drawable.ic_action_search);
		alertDialog.setMessage(message);
		alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
			public void onClick(DialogInterface dialog, int which) {
				dialog.dismiss();
				if (isFinishedActivity) {
					finish();
				}
			}
		});
		alertDialog.show();
	}

}
